// import { ref } from 'vue'


const hasDirective = {
    mounted(el, binding) {
        // 数组参数通过 value 获取
        // const arrayParam = binding.value;
        // 字符串参数通过 arg 获取
        const stringParam = binding.value;

        // console.log('Array Parameter:', arrayParam);
        console.log('String Parameter:', stringParam);

        if (!checkPermission(stringParam)) {
            el.parentNode.removeChild(el)
        }

        function checkPermission(value) {
            let isExist = false;
            const source = JSON.parse(localStorage.getItem("auth"))
            console.log("xxx", source);
            if (source.interfacepermission.includes(value)){
                isExist = true;
            }
            return isExist
        }

    },
    
}

export default hasDirective